/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.GrantRequest.expensePurpose;

import researchgrants.parts.LoggedData.panels.lists.*;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * A set of panels to view and edit ExpensePurpose
 * LoggedDataPanelsList will provide the panels provided that LoggedDataPanelsListExpensePurpose will provide the population of the list within the edit panel
 * @author DOStudent1
 */
public class LoggedDataPanelsListExpensePurpose extends LoggedDataPanelsList {
    public SortedMap<String, String> getListMap() {
        SortedMap<String, String> expensePurposes=new TreeMap<String, String>();
        List<ExpensePurpose> allExpensePurposes=ExpensePurpose.getAllExpensePurposes();
        for (Iterator<ExpensePurpose> it = allExpensePurposes.iterator(); it.hasNext();) {
            ExpensePurpose expensePurpose = it.next();
            ListableLoggedData listableLoggedData=expensePurpose;
            expensePurposes.put(listableLoggedData.toListId(), listableLoggedData.toListValue());
        }
        return expensePurposes;
    }
}
